Strictness Analysis and let-to-case Transformation using Template Haskell
نویسندگان
چکیده
Metaprogramming consists of writing programs that generate or manipulate other programs. Template Haskell is a very recent extension of Haskell, currently implemented in the Glasgow Haskell Compiler, giving support to metaprogramming at compile time. Our aim is to apply these facilities in order to statically analyse programs and transform them at compile time. In this paper we use Template Haskell to implement an abstract interpretation based strictness analysis and a let-to-case transformation that uses the results of the analysis. This work shows the usefulness of the tool in order to incorporate new analyses and transformations into the compiler without modifying it.
منابع مشابه
Using Template Haskell for Abstract Interpretation
Metaprogramming consists of writing programs that generate or manipulate other programs. Template Haskell is a recent extension of Haskell, currently implemented in the Glasgow Haskell Compiler, giving support to metaprogramming at compile time. Our aim is to apply these facilities in order to statically analyse programs and transform them at compile time. In this paper we use Template Haskell ...
متن کاملEecient Strictness Analysis of Haskell in Haskell Using Abstract Reduction
The extraction of strictness information marks an indispensable element of an eecient compilation of lazy functional languages like Haskell. Based on the method of abstract reduction we have developed an eecient strictness analyser for a core language of Haskell. It is completely written in Haskell and compares favourably with known implementations. The implementation is based on the G #-machin...
متن کاملImplementing Projection-based Strictness Analysis
Projection-based backwards strictness analysis has been understood for some years. Surprisingly, even though the method is fairly simple and quite general, no reports of its implementation have appeared. This paper describes ideas underlying our prototype implementation of the analysis for a simple programming language. The implementation serves as a case study before applying the method in the...
متن کاملFast Strictness
Strictness analysis (at least for at domains) is well understood. For a few years the main concern was eeciency, since the standard analysis was shown to be exponential in the worst case 9]. Thus lots of research evolved to nd eecient average-case algorithms. In Yale Haskell we have implemented a strictness analyzer that computes x-points via symbolic manipulation of boolean functions. This ext...
متن کاملA Complete Proof of Nöcker’s Strictness Analysis
This paper proves correctness of Nöcker’s method of strictness analysis, implemented in the Clean compiler, which is an effective way for strictness analysis in lazy functional languages based on their operational semantics. We improve upon the work of Clark, Hankin and Hunt did on the correctness of the abstract reduction rules. Our method fully considers the cycle detection rules, which are t...
متن کامل